<template>
	<view>
		<navbar title="意向客户" :autoBack="true"></navbar>
		<view class="con">
			<view class="con__b">
				<scroll-view scroll-y="true" style="height: 100%;">
					<view class="con__list" v-if="list.length>0">
						<view class="con__list__item" v-for="(item,index) in list" :key="index">
							<view class="u-flex">
								<image :src="URL(item.avatar)" class="con__list__item__tx" mode="aspectFill"></image>
								<view class="" style="flex: 1;">
									<view class="u-flex u-flex-items-start u-flex-between">
										<view class="con__list__item__name">
											{{item.username}}
										</view>
										<u-button color="#3262FD" @click="clicksh(item)"
											:customStyle='{width:"106rpx",height:"50rpx",margin:"6rpx 0 0",padding:0,borderRadius:"5rpx",fontSize:"20rpx",color:"#fff"}'>去申请</u-button>
									</view>
									<view class="con__list__item__t" style="margin-top: 20rpx;margin-bottom: 27rpx;">
										贷款金额:{{item.dedamount}}元
									</view>
									<view class="con__list__item__t">
										提交时间:{{$u.timeFormat(item.createtime, 'yyyy-mm-dd')}}
										<text class="con__list__item__xs">{{item.saleName}}</text>
									</view>
								</view>
							</view>
						</view>
					</view>
					<u-empty v-else></u-empty>
				</scroll-view>
			</view>
		</view>
	</view>
</template>

<script>
	import boos from '@/api/_boos.js'
	export default {
		data() {
			return {
				status: 2,
				list: []
			};
		},
		methods: {
			clicktab(e) {
				this.status = e.status
				this.getlist()
			},
			clicksh(item) {
				this.$store.commit('setyxkh',item)
				uni.navigateTo({
					url:'/pages/tdsh/submit'
				})
			},
			async getlist() {
				let res = await boos.createNotLoan()
				if (res.data.code == 1) {
					this.list = res.data.data
				}
			}
		},
		onShow() {
			this.getlist()
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f8f8f8;
	}

	.con {
		&__t {
			height: 104rpx;
			background: #FFFFFF;
			display: flex;
			align-items: center;
			justify-content: center;
		}

		&__b {
			height: calc(100vh - 44px - var(--status-bar-height) - 72rpx);
			background-color: #f8f8f8;
			padding: 30rpx 30rpx 42rpx;
		}

		&__list {
			&__item {
				background: #FFFFFF;
				border-radius: 20rpx;
				margin-bottom: 30rpx;
				padding: 32rpx 26rpx 40rpx 32rpx;

				&__tx {
					width: 92rpx;
					height: 92rpx;
					background: #3262FD;
					border-radius: 46rpx;
					margin-right: 15rpx;
				}

				&__name {
					font-family: PingFang SC;
					font-weight: bold;
					font-size: 30rpx;
					color: #1E1E1E;
					line-height: 36rpx;
					margin: 10rpx 0 0;
				}

				&__t {
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 24rpx;
					color: #7A7A7A;
					line-height: 24rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;

				}

				&__xs {
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 24rpx;
					color: #3262FD;
					line-height: 24rpx;
				}

				&__status {
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 24rpx;
					color: #78797E;
					line-height: 24rpx;
				}

				.s1 {
					background: #F1F5F8;
					color: #626667;
				}

				.s2 {
					background: rgba(253, 122, 50, .15);
					color: #FD5832;
				}

				.s3 {
					background: #E0E8FF;
					color: #3262FD;
				}

				.s4 {
					background: rgba(36, 173, 36, .2);
					color: #24AD24;
				}

			}
		}
	}
</style>